#!/bin/sh
# Copyright (c) 2011, bkil.hu
# This program is free software and can be distributed under the terms of
# the GNU General Public License v2,
# see COPYING for detailed licensing terms.

. sh_lib.sh


copy(){
 echo "Please insert the USB binary cache drive to install."
 echo

 while ! pencp.sh 2>/dev/null
 do
  sleep 1
 done
}

main(){
 date

 mozbk.sh
 DEST=/tmp/$USER

 if [ -d "$DEST" ]
 then
  echo "$DEST exists, skipped."
  echo
 else
  copy
 fi

 xterm -e "ff.sh" &

 dn sleep 6
 echo
 echo "You can now safely remove the drive."
 echo
 echo "Press enter to delete the temporary files from $DEST"
 dn read REPLY
 dn nice rm -Rf $DEST
}

main "$@"

